﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Fake_Shop_WebApi.Migrations
{
    public partial class AddShoppinganLineItem2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_LineItems_ShoppingCarts_ShoppingCartId1",
                table: "LineItems");

            migrationBuilder.DropIndex(
                name: "IX_LineItems_ShoppingCartId1",
                table: "LineItems");

            migrationBuilder.DropColumn(
                name: "ShoppingCartId1",
                table: "LineItems");

            migrationBuilder.AlterColumn<Guid>(
                name: "ShoppingCartId",
                table: "LineItems",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.UpdateData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "308660dc-ae51-480f-824d-7dca6714c3e2",
                column: "ConcurrencyStamp",
                value: "dff60217-f50a-48b8-947b-baa94a59e011");

            migrationBuilder.UpdateData(
                table: "AspNetUsers",
                keyColumn: "Id",
                keyValue: "90184155-dee0-40c9-bb1e-b5ed07afc04e",
                columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
                values: new object[] { "8d1891be-dc0d-42e9-a4d4-074e9f1e6b4e", "AQAAAAEAACcQAAAAEOqGG35K4AO4ohp0Ut+JOudHWgbGnRMNy+FSDd+kHU5KS5I8Vv7yh8tuXmt93bMF2w==", "106845f5-cdbc-48fe-82f6-1b56f3404949" });

            migrationBuilder.CreateIndex(
                name: "IX_LineItems_ShoppingCartId",
                table: "LineItems",
                column: "ShoppingCartId");

            migrationBuilder.AddForeignKey(
                name: "FK_LineItems_ShoppingCarts_ShoppingCartId",
                table: "LineItems",
                column: "ShoppingCartId",
                principalTable: "ShoppingCarts",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_LineItems_ShoppingCarts_ShoppingCartId",
                table: "LineItems");

            migrationBuilder.DropIndex(
                name: "IX_LineItems_ShoppingCartId",
                table: "LineItems");

            migrationBuilder.AlterColumn<string>(
                name: "ShoppingCartId",
                table: "LineItems",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(Guid),
                oldNullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "ShoppingCartId1",
                table: "LineItems",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.UpdateData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "308660dc-ae51-480f-824d-7dca6714c3e2",
                column: "ConcurrencyStamp",
                value: "658aaee2-f6be-45f2-8cfa-9946ade51344");

            migrationBuilder.UpdateData(
                table: "AspNetUsers",
                keyColumn: "Id",
                keyValue: "90184155-dee0-40c9-bb1e-b5ed07afc04e",
                columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" },
                values: new object[] { "a7c07642-8ace-405f-8024-f3eb4825b397", "AQAAAAEAACcQAAAAELLAGw6MyALcnYXi0dipbLauUvEU5JaSsKO5H+S8rZrVxNBYTiA8yFSDNopw2vwJhQ==", "35b51bfa-467c-4e19-bb9b-639ce645f2bb" });

            migrationBuilder.CreateIndex(
                name: "IX_LineItems_ShoppingCartId1",
                table: "LineItems",
                column: "ShoppingCartId1");

            migrationBuilder.AddForeignKey(
                name: "FK_LineItems_ShoppingCarts_ShoppingCartId1",
                table: "LineItems",
                column: "ShoppingCartId1",
                principalTable: "ShoppingCarts",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
    }
}
